package com.tiandao.mofang.core.jingji;

import com.tiandao.mofang.ui.MFFrame;

import java.util.Date;

import static com.tiandao.mofang.core.jingji.LuJian.listener;

/**
 * 论剑停止监听器
 */
public class LuJianStopListenerThread implements Runnable {


    @Override
    public void run() {
        for (int i = 0;i<200;i++){
            long a = System.currentTimeMillis();
            try {
                Thread.sleep(1000);
                if(listener()){
                    MFFrame.textArea.append(new Date()+":    监听到论剑结束!\n");
                    System.out.println("监听到论剑结束!\n");
                    LuJian.flag = 2;
                    break;
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("监听器(结束)执行时间: " + (System.currentTimeMillis() - a) );
        }
    }

}
